home *** CD-ROM | disk | FTP | other *** search
/ Commodore Free 21 / Commodore_Free_Issue_21_2008_Commodore_Computer_Club.d64 / t.b guide 6.1 < prev    next >
Text File  |  2023-02-26  |  11KB  |  379 lines

  1. u
  2. In the Beginning Part 6
  3. \Lord Ronin from Q-Link\
  4.  
  5. Chapter 6, Section 2
  6.  
  7. That was a lot to present. Now we are
  8. at the last file for this disk side.
  9. We are going back to the manual and
  10. the bits on introducing the user to
  11. Basic v2 programming.
  12.  
  13.  Remember that you can use the '?' to
  14. replace the word print.
  15.  
  16.  Lets mess with a few keys. We did
  17. editing a bit already. Did a bit on
  18. the print thing. Lets mess a bit more
  19. with the print thing. So type in the
  20. following or something close to it.
  21.  
  22. 10?"commodore", <yeah put in the comma
  23. and then press return>
  24.  
  25. 20goto 10 <return again>
  26.  
  27.  Now type RUN. Or if you are close to
  28. being as lazy as me. Just type R and a
  29. shifted U. The U will be that quarter
  30. circle on the right side of the U key.
  31. If you are in upper case. If in lower
  32. case 
  33. it will look on the screen as rU. That
  34. is the short hand programmers way of
  35. telling the computer to run. Do need
  36. to press
  37. return.
  38.  
  39.  You now have four commodore across
  40. the screen running on forever until
  41. you press the run/stop key. Do that
  42. and then on line 10 of the programme.
  43. Delete the comma and run it again. 
  44. Remember to press return on the line.
  45. that locks in what you write or edit.
  46. No return and it keeps what was there
  47. or doesn't record it to memory.
  48.  
  49.  What you now have is a string down
  50. the left side of the C= saying
  51. commodore. Or what ever you put in
  52. there. Only difference is the comma.
  53. Oh yeah press run/stop to stop that or
  54. it will go on 
  55. forever.
  56.  
  57.  A few things to see about this right
  58. now. That comma made the print on the
  59. screen come out in 4 per a line. Less
  60. if you wrote more characters in the
  61. word to be printed. This is setting
  62. the print 
  63. to each of the 4 groups, or tabs at
  64. the 10 space mark of the 40 characters
  65. on the screen line. No comma and it
  66. just does one line.
  67.  
  68.  Next is seeing that a computer
  69. programme is more literal than me. It
  70. will operate from the lowest number
  71. line to the highest. Unless some other
  72. command moves it to a new location in
  73. the programme. In this instance it is
  74. the goto command. Telling the computer
  75. to print line 10. Then on 20 it is
  76. telling it to return to line 10. Do
  77. the action there and when it
  78. automatically drops to line 20. As the
  79. programme will drop to the next
  80. command line after performing the
  81. previous line function. The function
  82. on line 20 tells it to go back to 10.
  83. We have a forever loop here. Not a
  84. real great programme. Element of it is
  85. used a lot in programming.
  86.  
  87.  
  88.  Book takes us to the "Variables"
  89. next. Sort of like the math term, if
  90. you went into algebra and trig. If not
  91. then this may actually be easier for
  92. you. Learning the terms without
  93. preconceived notions of the meanings.
  94.  
  95.  A variable is a something that can
  96. change in the course of the operation
  97. of the programme. It is also a  holder
  98. of a something. And if you understand
  99. that explanation you are much better
  100. than me.
  101.  
  102.  V=9.23
  103.  
  104.  V%=100
  105.  
  106.  V$="since 1978ce I've played AD&D"
  107.  
  108.  That is a light hearted look at the
  109. three types of variables in the C=.
  110. First one V=9.25 uses a floating
  111.  
  112. point. You get the decimal part of the
  113. number. V%=100 will give you what they
  114. call the integer number. No decimal
  115. point. V$= well the text that I wrote
  116. in the quotes. Is called a "string".
  117. OK full title is a text string. But I
  118. know of no one that calls it that.
  119. According to the book these are memory
  120. locations in the computer. No I don't
  121. understand that at all. Said I was a
  122. lamer at programming. And at this
  123. point in time that bit isn't important
  124. for you to use the C=. Just telling
  125. you what the book says.
  126.  
  127.  
  128.  A programme they give you to type in
  129. to understand this variable part is..
  130.  
  131. 10X%=15
  132.  
  133. 20X=23.5
  134.  
  135. 30X$="THE SUM OF X%+X ="
  136.  
  137.  Note that the actual math computation
  138. is not in the programme lines. This is
  139. to show you the things of or for a
  140. variable.
  141.  
  142. 10X%=15
  143.  
  144. 20X=23.5
  145.  
  146. 30D=X%+X
  147.  
  148. 40X$="THE SUM OF X%+X ="
  149.  
  150. 50?X$,D
  151.  
  152.  Might work, I just came up with that
  153. lay out to show you some points we
  154. will deal with in the future.
  155. Basically what we have done in the
  156. above is to define the floating, the
  157. integer and the text. 
  158. Then add the math part. Giving it a
  159. new variable lable. Line 50 is
  160. supposed to print out the text and
  161. then the actual result. Here is one
  162. based on the Commodore programme
  163. lesson book.
  164.  
  165. 10Z$="CAT"
  166.  
  167. 20A$="BOX"
  168.  
  169. 30?Z$+A$
  170.  
  171.  Now if I remember that correctly the
  172. print will print out the word "catbox"
  173. on the screen. Just showing you how
  174. variables can be combined in a
  175. programme.
  176.  
  177.  Before we go any farther along. There
  178. are some things we will be doing in
  179. typing in a programme. You may want to
  180. save these to disk or tape for later.
  181. Tape users, make certain that there is
  182. nothing on the tape you want to save.
  183. I personally take a pencil, ah the
  184. standard wooden one, and put it in the
  185. hole. Slowly twisting the wheel till
  186. the leader tape is past the cotton
  187. pad. That way you know that you are
  188. going to be on recordable media when
  189. you start to save. Saving the
  190. programme to tape goes this way. You
  191. type
  192.  
  193. SAVE"name you give it" note that the
  194. name can not be longer than 16
  195. characters
  196.  
  197.  After hitting return. You will see on
  198. the screen
  199.  
  200. PRESS PLAY AND RECORD ON TAPE
  201.  
  202.  Do that and the screen goes blank.
  203. Becoming, or so it says the same
  204. colour as the border. Tape takes some
  205. time, but when it is finished. You
  206. will get that READY prompt on the
  207. screen.
  208.  
  209.  Now disk users. You have a little bit
  210. more to work with at this point in
  211. time. First do you have a disk that
  212. you can use? Before you answer that
  213. one. Take a moment to reflect. If you
  214. are like most people I have started
  215. off on the C=. Your set up is used and
  216. there may be a hundred disks. Which
  217. one to use? Well if you have some that
  218. are unused. That is great. Those are
  219. the ones that when you do a directory
  220. listing. Come up with nothing. Just an
  221. error. Remember that you type in LOAD,
  222. wait a moment lets get lazy and do the
  223. short cut. That is the L and the
  224. shifted O. Symbol for that in upper
  225. case is that upper left angle on the
  226. right of the key. In lower case it
  227. would look like lO. Now if you have
  228. jiffy dos it is just the F1 key. If
  229. you have a cart like the MACH or the
  230. TURBO and there are some others. Try
  231. just the $ symbol for the directory.
  232.  
  233.  Those that are stock. The command is
  234. lO"$",8 then press return. That lO is
  235. the short form load command. The ""
  236. part is the border for the item to be
  237. loaded. Since the $ is in that
  238. bordered area. You are loading the $
  239. or the directory of the disk. Comma
  240. separate and the 8 is the device
  241. number. Once that is done, press LIST
  242. or the short form of L and a shifted
  243. I. In upper case it is the right upper
  244. circle part on the I key. In lower
  245. case it looks like lI.
  246.  
  247.  If the directory lists the things I
  248. mentioned in an earlier installment.
  249. Then put it off to the side. If it
  250. doesn't do a thing and sits there
  251. after some scary noises from the
  252. drive. There is a good chance it is a
  253. blank unformatted disk.
  254.  
  255.  Guess it is now time to go into some
  256. of the stuff on a disk. Factory disks
  257. had a nice lable put on them. Which
  258. also has a tendency to fall off over
  259. time. So there may not be a lable on
  260. the disk. But it is a factory disk.
  261. Looking at the directory. Seeing the
  262. listing of the files and the reverse
  263. video bar above it with the title and
  264. the 2 character id code. Well that can
  265. help you decide if it is a good to use
  266. or not disk. Not the id code as much
  267. as the disk name. I have seen on
  268. factory disks for id codes. Well
  269. things like "s1" or "sa" to indicate
  270. the first side. I have seen them use
  271. "00" and "01" to indicate the sides. 
  272.  
  273. And other forms that are simple that
  274. many beginners use for their own
  275. disks. Some I have seen use a name in
  276. up to 5 charcters. This isn't a sign
  277. of a factory disk. I have a small tool
  278. that lets me make 5 character id
  279. codes. What you are looking for more
  280. is the name that the disk was given.
  281. Certain non media broadcastable words,
  282. are a big clue that the disk isn't
  283. factory. "GREG'S STUFF" is another
  284. type of clue.
  285.  
  286.  I'm going into great detail and pains
  287. on this one. At your beginning level,
  288. well honestly you don't know what you
  289. have or how to use it. You could
  290. destroy a disk of important tools and
  291. utilities that you would or could want
  292. in the future. Trust me on this one, I
  293. have done it in the past more times
  294. that I want to admit.
  295.  
  296.  If you have unformatted disks. The
  297. ones that made the drive make haunted
  298. house noises and then did an error
  299. thing. Then you need to format it. If
  300. not then we have a couple of things to
  301. do at this point. One is to knowthat
  302. you can buy 5 1/4 inch disks. There
  303. are some companies that sell new ones
  304. online. Places like ebay have some
  305. from time to time for sale. Just need
  306. to look around. I scored some up from
  307. a computer repair shop and from a
  308. close out at stationary store.
  309. Remember that you want double sided
  310. double density and soft sectored.
  311.  
  312.  Lets take a look at the disks that
  313. you put in that pile of "I don't know
  314. what the smeg they are." Odds are that
  315. there are a few of them with very
  316. little on them. You see some of the
  317. games, want you to have a save disk.
  318. So the previous owner took a disk.
  319. Stuck it in the machine and had the
  320. game programme format it for him. This
  321. saves his game in progress. In fact on
  322. some you can save multiple games. But
  323. the point is that the disk is
  324. formatted. Most of the time it will
  325. work as stock. 
  326.  
  327. But I have to say here that there were
  328. some that did a non standard format
  329. for the game. I haven't found many of
  330. that sort thatwould read right on a
  331. directory search. Well there could be
  332. 200 of more blocks free on the disk.
  333. When you save, unless you use the same
  334. name as an existing file. The disk
  335. drive micro processor checks for
  336. names, and for space. So it won't
  337. write over anything existing.
  338.  
  339.  Another thing that you might see and
  340. I mentioned lightly earlier. You disk
  341. may have only one side with that
  342. square type notch. I have taken in
  343. collections that way. Here we need to
  344. be careful. The disk could be a
  345. factory that uses side two as a read
  346. only disk. In fact if you have disks
  347. with no notches at all. Most likely
  348. you have a factory disk. That notch
  349. hole allows you to write to the disk.
  350. No notch, no writing. Sub note, there
  351. are ways around that fact.
  352.  
  353.  Speaking of that before we go
  354. farther. You may find disks that have
  355. a bit of tape over the notch. These
  356. can be black the most common, white
  357. and a silver one. That last one is in
  358. some machines worthless. Reflecting
  359. the beam back and has been known to
  360. fake the drive into thinking there is
  361. a notch. Disk boxes from the store had
  362. labels, the disks of course and a
  363. sheet of these notch covers. 
  364.  
  365. Over time they dry out and slip up.
  366. Making a mess in the drive and hard to
  367. insert. Labels do the same thing, if
  368. not well placed on the disk. Well that
  369. disk notch cover means that the data
  370. was important to the previous user.
  371. Doesn't mean that it is important to
  372. you. But leave that disk to the side.
  373. Might have some things that you need
  374. later on.
  375.  
  376.         Continued in Section 2
  377.  
  378.  
  379.